Skip Headers

Oracle® Database Backup and Recovery Reference 10g Release 2 (10.2) Part Number B14194-03 |
Home | Book List | Contents | Index | Master Index | Feedback

Previous | Next
| View PDF

# CONNECT

Syntax

connect::=

Description of the illustration connect.gif

Purpose

To establish a connection between RMAN and a target, auxiliary, or recovery catalog database.

Note: When connecting from the command line, the password may be visible to other users on the system. The CONNECT command used from within RMAN avoids this problem.

See Also: "cmdLine" for command line connection options

Restrictions and Usage Notes

- You can only run the `CONNECT` `TARGET`, `CONNECT` `CATALOG`, and `CONNECT` `AUXILIARY` commands if you are at the RMAN prompt and if you are not already connected to the specified databases.

- If you need to connect to a different target, catalog, or auxiliary database, then you must start a new RMAN session.

- You cannot use `the CONNECT` `CATALOG` command when RMAN is in the default `NOCATALOG` mode, that is, when these conditions are met:

  - You started RMAN without specifying either `CATALOG` or `NOCATALOG`.

  - You have already run a command such as `BACKUP` that requires a repository connection.

Keywords and Parameters

Syntax Element | Description
--- | ---
`CONNECT` `AUXILIARY` connectStringSpec | Establishes a connection between RMAN and an auxiliary instance. Auxiliary instances are used with the `TRANSPORT` `TABLESPACE` and `DUPLICATE` commands, and during RMAN TSPITR.
`CONNECT` `CATALOG` connectStringSpec | Establishes a connection between RMAN and the recovery catalog database. You must run this command before running any command that requires a repository. Otherwise, RMAN defaults to `NOCATALOG` mode and invalidates the use of `CONNECT` `CATALOG` in the session.
`CONNECT` `TARGET` connectStringSpec | Establishes a connection between RMAN and the target database.

Examples

Connecting Without a Recovery Catalog: Example This example starts RMAN and then connects to the target database with an Oracle Net service name `prod1`:

    % rman NOCATALOG
    RMAN> CONNECT TARGET sys/change_on_install@prod1;

Connecting in the Default NOCATALOG Mode: Example This example starts RMAN and then connects to the target through Oracle Net. Because `BACKUP` is run and no `CONNECT` `CATALOG` has been run, RMAN defaults to `NOCATALOG` mode:

    % rman
    RMAN> CONNECT TARGET sys/change_on_install@prod1;
    RMAN> BACKUP DATAFILE 7;
    # You cannot run CONNECT CATALOG after this point because RMAN has defaulted to NOCATALOG

Connecting with a Recovery Catalog: Example This example starts RMAN and then connects to the target database `prod1` by using operating system authentication and the recovery catalog database `rcat` by using a password file:

    % rman

    RMAN> CONNECT TARGET / ;

    RMAN> CONNECT CATALOG rman/rman@rcat;

Connecting to Target, Recovery Catalog, and Auxiliary Databases: Example This example connects to three databases specifying a username and password for each:

    % rman

    RMAN> CONNECT TARGET SYS/sysdba@prod1;

    RMAN> CONNECT CATALOG rman/rman@rcat;

    RMAN> CONNECT AUXILIARY SYS/sysdba@dupdb;